<template>
  <div>
    <el-row>
      <el-col :span="24">
        <table-template :list="List" :item="item" :names="names" @edit="edit" @delete="Delete" @info="info"></table-template>
        <el-pagination
          layout="prev, pager, next"
          :total="1000"
          class="pagination">
        </el-pagination>
      </el-col>
    </el-row>
    <el-dialog title="学生信息表" :visible.sync="visible">
      <table-info :item="item" :names="names" :imgUrl="'http://element-cn.eleme.io/static/hamburger.50e4091.png'" :hasimg="true"></table-info>
    </el-dialog>
  </div>
</template>

<script>
import tableTemplate from "@/components/tableTemplate";
import tableInfo from "@/components/InfoTemplate";

export default {
  components: {
    tableTemplate,
    tableInfo
  },
  data() {
    return {
      visible:false,
      List: [
        {
          id: 1,
          name: "张三",
          age: 18,
          address:'江苏南通',
          hobby:'coding',
          school:'南通大学'
        },
        {
          id: 1,
          name: "李四",
          age: 28,
          address:'江苏无锡',
          hobby:'coding',
          school:'中北大学'
        }
      ],
      item: {
        id: 1,
        name: "李四",
        age: 18,
        address:'江苏无锡',
        hobby:'coding',
        school:'南通大学'
      },
      names: ["编号", "姓名", "年龄","家庭住址","爱好","毕业院校"]
    };
  },
  methods: {
    edit(obj) {
     
    },
    Delete(obj) {},
    info(obj) {
       this.item = obj
       this.visible = !this.visible
    }
  }
};
</script>

<style scoped>
.pagination{
  float:right;
  margin-right:-10px;
  margin-top:10px;
}
</style>
